<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
        <my-main></my-main>
    </div>

    <template id="main">
        <div>
            我将来是局部组件
        </div>
    </template>

    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>

        let Main = {
            template: "#main"
        }
        
        new Vue({
            // 元素
            el: "#app",
            // 注册组件
            components: {
                // key  组件的名称
                // value  
                "my-main": Main
            }
        })
    </script>
</body>
</html>